﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RabbitMQ.Client;

namespace JWUX.Supermarket.MQL
{
    public sealed class StationClient : Client
    {
        #region 构造和方法

        public StationClient(string hostName, string pcName)
            : base(hostName, pcName)
        {
        }

        public override void SendMessage(string message)
        {
            try
            {
                if (_channel == null)
                {
                    _channel = _connection.CreateModel();
                }
                _channel.BasicPublish("", QUEUE_REQUEST, null, Encoding.Default.GetBytes(message));
            }
            catch { throw; }
        }

        public override void GetSingleMessage()
        {
        }

        #endregion
    }
}
